//TODO: NOT WORKING

dojo.provide("afitco.eTajer.widgets.categories.ContextMenu");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("dijit.Menu");

dojo.declare("afitco.eTajer.widgets.categories.ContextMenu",
    /* Extends */ [dijit._Widget, dijit._Templated],
    {
        widgetsInTemplate: true,
        templatePath: dojo.moduleUrl("afitco.eTajer.widgets.categories","templates/ContextMenu.html"),

//        buildRendering: function()
//        {
//            console.log(this.targetNodeIds);
//            console.log(["hi"]);
//            div = document.createElement("div");
//            this.pMenu = new dijit.Menu({
//                targetNodeIds: [this.targetNodeId]
//            });
//            this.pMenu.addChild(new dijit.MenuItem({
//                label:"Simple menu item"
//            }));
//            this.pMenu.addChild(new dijit.MenuItem({
//                label:"Disabled menu item",
//                disabled: true
//            }));
//            this.pMenu.addChild(new dijit.MenuItem({
//                label:"Menu Item With an icon",
//                iconClass:"dijitEditorIcon dijitEditorIconCut",
//                onClick: function(){
//                    alert('i was clicked')
//                    }
//            }));
//            console.log("Before");
//            div.appendChild(this.pMenu.domNode);
//            console.log("After");
//            this.domNode =this.pMenu.domNode;
//
//            this.pMenu.startup();
//
//        },
        startup: function()
        {
            console.log("afitco.eTajer.widgets.categories.ContextMenu.startup");
            this.inherited(arguments);
            
            console.log(this.contextMenu);
        },
        postMixInProperties: function()
        {
            console.log("afitco.eTajer.widgets.categories.ContextMenu.postMixInProperties");
            this.inherited(arguments);

            
        },

        postCreate: function()
        {
            console.log("afitco.eTajer.widgets.categories.ContextMenu.postCreate");
            this.contextMenu.targetNodeIds = [this.targetNodeId];
            this.inherited(arguments);
            
        },

        targetNodeId: "",

        menu_onClick: function(arg1, arg2, arg3)
        {
            console.log("menu_onClick");
            console.log(arg1);
            console.log(arg2);
            console.log(arg3);
        }
    });